package com.linux.huhx.baseBean;

import com.linux.huhx.utils.CodeUtils;
import org.apache.commons.io.FileUtils;

/**
 * Created by huhx on 2017-06-16.
 */
public class FieldJavaBean {
    private String fieldType;
    private String fieldName;
    private String upperName;
    private String fieldComment;

    public FieldJavaBean() {
        this.fieldType = "String";
    }

    public FieldJavaBean(String fieldType, String fieldName, String fieldComment) {
        this.fieldType = fieldType;
        this.fieldName = fieldName;
        this.upperName = CodeUtils.transforFirstLetterUpper(fieldName);
        this.fieldComment = fieldComment;
    }

    public FieldJavaBean(String fieldName, String fieldComment) {
        this.fieldType = "String";
        this.fieldName = fieldName;
        this.upperName = CodeUtils.transforFirstLetterUpper(fieldName);
        this.fieldComment = fieldComment;
    }

    public String getFieldType() {
        return fieldType;
    }

    public void setFieldType(String fieldType) {
        this.fieldType = fieldType;
    }

    public String getFieldName() {
        return fieldName;
    }

    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
        this.upperName = CodeUtils.transforFirstLetterUpper(fieldName);
    }

    public String getUpperName() {
        return upperName;
    }

    // 这里的get、set方法都需要，否则bean2Map方法会得不到数据
    public void setUpperName(String upperName) {
        this.upperName = upperName;
    }

    public String getFieldComment() {
        return fieldComment;
    }

    public void setFieldComment(String fieldComment) {
        this.fieldComment = fieldComment;
    }
}
